unit uFrm_dialog_select_text;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, XPMan;

type
  Tfrm_sel_text = class(TForm)
    btn_ok: TButton;
    btn_cancel: TButton;
    mmo: TMemo;
    xpmnfst1: TXPManifest;
    procedure btn_cancelClick(Sender: TObject);
    procedure btn_okClick(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure mmoKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure FormKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure btn_okKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure btn_cancelKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
  private
    { Private declarations }
  public
    { Public declarations }
    modal_res : Boolean;
  end;

var
  frm_sel_text: Tfrm_sel_text;

implementation

{$R *.dfm}

procedure Tfrm_sel_text.btn_cancelClick(Sender: TObject);
begin
modal_res := false;
  Close();
end;

procedure Tfrm_sel_text.btn_okClick(Sender: TObject);
begin
  modal_res := True;
  Close();
end;

procedure Tfrm_sel_text.FormCreate(Sender: TObject);
begin
    modal_res := False;
end;

procedure Tfrm_sel_text.mmoKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
   if Key = 27 then
    begin // esc
      Close();

    end;
end;

procedure Tfrm_sel_text.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
    if Key = 27 then
    begin // esc
      Close();

    end;
end;

procedure Tfrm_sel_text.btn_okKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
   if Key = 27 then
    begin // esc
      Close();

    end;
end;

procedure Tfrm_sel_text.btn_cancelKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
   if Key = 27 then
    begin // esc
      Close();

    end;
end;

end.
